import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import {BsMatchListPage} from "../match/bs-match-list";
@IonicPage()
@Component({
  selector: 'page-bs-america',
  template: `
    <bt-region-match [(type)]="type" [(code)] = "code" (toMatch)="goMatchList($event)" (toLeague)="goLeaguePage($event)"></bt-region-match>
  `
})
export class BsAmericaPage {

      code = 2;
      type;
      constructor(public navCtrl: NavController, public navParams: NavParams) {
      }

      ionViewDidLoad() {
          this.type = +this.navParams.get('type') || 1;
          //console.log('ionViewDidLoad BsAmericaPage');
      }

      //跳转到国家联赛列表
      goMatchList($event){
          this.navCtrl.parent.push('BsMatchListPage',$event);
      }

      //联赛首页，leagueId
      goLeaguePage($event){
          this.navCtrl.parent.push('LeagueTabsPage',{leagueId:$event});
      }

}
